<form (ngSubmit)="onSubmit()" [formGroup]="form">
    <div *ngFor="let dombase of dombases" class="form-row">
        <label [attr.for]="dombase.key">{{dombase.label}}</label>

        <div [ngSwitch]="dombase.controlType">

            <input *ngSwitchCase="'textbox'" [formControlName]="dombase.key" [type]="dombase.type">

            <select *ngSwitchCase="'dropdown'" [formControlName]="dombase.key">
                <option *ngFor="let opt of dombase.options" [value]="opt.key">{{opt.value}}</option>
            </select>

            <ng-container *ngSwitchCase="'radiogroup'">
                <ng-container *ngFor="let l of dombase.radios">
                    {{l.text}}<input type="radio" [name]="dombase.key" [value]="l.val" [formControlName]="dombase.key">
                </ng-container>
            </ng-container>
        </div>

        <div class="errorMessage" *ngIf="funInvalid(dombase)">{{dombase.label}} is required</div>
    </div>


    <div class="form-row">
        <button type="submit">Save</button>
    </div>
</form>
<div *ngIf="payLoad" class="form-row">
    <strong>Saved the following values</strong><br>{{payLoad}}
</div>